﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="dictionary_list.aspx.cs" Inherits="admin_manager_dictionary_list" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>字典管理</title>
    <link href="../css/default.css" rel="stylesheet" type="text/css" />

    <script src="../js/CheckBox.js" type="text/javascript"></script>

<%--    <script language="javascript"> 
function deldata(){
  	var s;
	var url;
	s = '该操作不能恢复,是否确认?'; 
	
	if(!isChecked(form1.idstr)){ 
		alert("请选择要删除的用户!");
		return false;
	}	
	if (confirm(s)) {
		form1.action = "";
		form1.submit();
		return true;
    }
}
        
    </script>--%>
    <script language="javascript"> 
    function delect(){
            var flag=false;
            flag=confirm('此操作不能恢复,您确定删除吗?')
            return flag;
        }
     function del(obj){
       if(!ischecked(obj)){
        alert("请选择要删除的用户！")
        return;
       }
            var flag=false;
            flag=confirm('此操作不能恢复,您确定删除吗?')
            return flag;
        }
        function ischecked(obj){
        var chechk=false;
          var frm= obj;
          for(var i=0;i<frm.elements.length;i++){
            var e=frm.elements[i];
            if(e.name!=="allbox"&&e.type=="checkbox"&&e.checked){
            chechk=true;
            }
           }
            return chechk;
        }
    </script>

</head>
<body>
    <form id="Form2" name="Form1" runat="server">
    <table width="100%" height="600" border="0" align="left" cellpadding="0" cellspacing="0"
        bgcolor="#FFFFFF">
        <tr>
            <td height="415" align="left" valign="top" class="rightbg">
                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td height="25" >
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
                                <tr>
                                    <td height="3" bgcolor="#A49B81">
                                    </td>
                                </tr>
                                <tr>
                                    <td height="22" background="../images/position_bg.gif" bgcolor="#EEF6FE" class="subnav"
                                        style="background-repeat: repeat-y; background-position: left; padding-left: 6px;
                                        padding-top: 3px;">
                                        <%--<a href="dictionary_list.aspx?layerid=<%=Layerid %>">字典管理</a>&nbsp;&nbsp;<img src='../images/subnav_dot.gif'
                                            width='9' height='9' />&nbsp;&nbsp;字典列表&nbsp;&nbsp;--%>
                                            <asp:Label ID="headers" runat="server" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td height="20">
                        </td>
                    </tr>
                    <tr>
                        <td height="21">
                            <table border="0" cellpadding="0" cellspacing="0" height="21">
                                <tr>
                                    <td width="25">
                                        &nbsp;
                                    </td>
                                    <td width="100" align="left">
                                        <table width="80" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td width="3">
                                                    <img src="../images/btn_blue_left.gif" width="3" height="21" />
                                                </td>
                                                <td width="26" align="center" background="../images/btn_blue_center.jpg">
                                                    <img src="../images/icon_add.gif" width="15" height="15" />
                                                </td>
                                                <td align="left" background="../images/btn_blue_center.jpg" class="subnav">
                                                <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">新增</asp:LinkButton>
                                                </td>
                                                <td width="3">
                                                    <img src="../images/btn_blue_right.jpg" width="3" height="21" />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                    <td width="100" align="center">
                                        <table width="80" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td width="3">
                                                    <img src="../images/btn_blue_left.gif" width="3" height="21" />
                                                </td>
                                                <td width="26" align="center" background="../images/btn_blue_center.jpg">
                                                    <img src="../images/icon_delete.gif" width="15" height="15" />
                                                </td>
                                                <td align="left" background="../images/btn_blue_center.jpg" class="subnav">
                                                    <asp:LinkButton ID="LinkButton2"
                                                        runat="server"  OnClientClick="return del(document.forms[0]);" OnClick="LinkButton2_Click">删 除</asp:LinkButton>
                                                </td>
                                                <td width="3">
                                                    <img src="../images/btn_blue_right.jpg" width="3" height="21" />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td height="15">
                        </td>
                    </tr>
                    <tr>
                        <td align="center" valign="top" style="padding-left: 10px;">                      
                              <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White"
                                BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="0" GridLines="None"
                                HeaderStyle-VerticalAlign="NotSet" HeaderStyle-HorizontalAlign="Center" PagerStyle-HorizontalAlign="Center"
                                RowStyle-HorizontalAlign="NotSet" PagerStyle-VerticalAlign="Middle" 
                                PagerStyle-Width="97%" Width="100%" onrowdeleting="GridView1_RowDeleting" 
                                onrowupdating="GridView1_RowUpdating" 
                                onselectedindexchanging="GridView1_SelectedIndexChanging" DataKeyNames="cid" 
                                onpageindexchanging="GridView1_PageIndexChanging" AllowPaging="True">
                                  <PagerSettings FirstPageText="第一页" LastPageText="最后一页" 
                                      NextPageText="下一页" PageButtonCount="5" PreviousPageText="上一页" 
                                      Visible="False" />
                                <RowStyle BackColor="#DEDFDE" ForeColor="Black" />                               
                                 <Columns>
                                    <asp:TemplateField HeaderText="全选">
                                        <HeaderTemplate>
                                            全选
                                            <input name="allbox" id="allbox" type="checkbox" onclick="CA()" />
                                        </HeaderTemplate>
                                        <ItemTemplate>                                            
                                            <asp:CheckBox ID="DeleteThis"
                                                runat="server" />
                                        </ItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="20%" />
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                         <ItemStyle CssClass="greytd" />
                                    </asp:TemplateField>
                                     <asp:BoundField DataField="cid" HeaderText="ID">
                                     <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="True" />
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                         <ItemStyle CssClass="greytd" />
                                     </asp:BoundField>
                                    <asp:BoundField DataField="cnname" HeaderText="名称" ReadOnly="True" 
                                         SortExpression="userName">
                                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="True" />
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                         <ItemStyle CssClass="greytd" />
                                    </asp:BoundField>
                                     <asp:TemplateField HeaderText="是否有效">
                                         <HeaderTemplate>
                                             是否有效
                                         </HeaderTemplate>
                                         <ItemTemplate>	                                            <%#Eval("availabilityflag").ToString()=="0"?"是":"否"%>
                                         </ItemTemplate>
                                         <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="20%" />
                                         <ItemStyle CssClass="greytd" HorizontalAlign="Center" VerticalAlign="Middle" />
                                     </asp:TemplateField>
                                    <asp:TemplateField HeaderText="管理">
                                        <ItemTemplate>
                                                <asp:LinkButton ID="LinkButton3" runat="server" 
                                                    CommandName="update">修改</asp:LinkButton>
                                                <asp:LinkButton ID="LinkButton4" runat="server"  OnClientClick="return delect()" 
                                                    CommandName="delete">删除字典</asp:LinkButton>
                                                <asp:LinkButton ID="LinkButton5" runat="server" 
                                                    CommandName="select">子字典</asp:LinkButton>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                        <ItemStyle CssClass="greytd" />
                                    </asp:TemplateField>
                                </Columns>                              
                                <PagerStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:GridView>
                              <br />
                         <asp:Label ID="label1" runat="server" Text=""></asp:Label>
                         <asp:Label ID="label2" runat="server" Text=""></asp:Label>

                          <asp:linkbutton id="btnFirst" runat="server" causesvalidation="False" 
                                commandargument="First" commandname="Page" text="首页" 
                                onclick="btnFirst_Click1" />
                          &nbsp;
                          <asp:linkbutton id="btnPrev" runat="server" causesvalidation="False" 
                                commandargument="Prev" commandname="Page" text="上一页" onclick="btnPrev_Click" />
                          &nbsp;
                          <asp:linkbutton id="btnNext" runat="server" causesvalidation="False" 
                                commandargument="Next" commandname="Page" text="下一页" onclick="btnNext_Click" />   
                          &nbsp;   
                          <asp:linkbutton id="btnLast" runat="server" causesvalidation="False" 
                                commandargument="Last" commandname="Page" text="尾页" onclick="btnLast_Click" />   
                          &nbsp;&nbsp;   
                          <asp:textbox id="txtNewPageIndex" runat="server" width="20px" text="" />
                          &nbsp;&nbsp;
                          <asp:linkbutton id="btnGo" runat="server" causesvalidation="False" 
                                commandargument="-1" commandname="Page" text="GO" onclick="btnGo_Click" />
                        </td>
                    </tr>
                    <tr>
                        <td align=center>
                            &nbsp;</td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <iframe name="comframe" style="display: none"></iframe>
    </form>
    <!--分页开始-->
    <!--分页结束-->
</body>
</html>